//
//  ClientInfo.swift
//
//  Created by 邱仙凯 on 2022/4/12
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct CJClientInfo: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let zTel = "z_tel"
    static let zContent = "z_content"
    static let zStaffNm = "z_staff_nm"
    static let zTbCompany = "z_tb_company"
    static let zPrice = "z_price"
      static let  zJpPrice = "z_jp_price"
    static let zAddress = "z_address"
    static let zCreateTm = "z_create_tm"
    static let zZbNum = "z_zb_num"
    static let zStaffId = "z_staff_id"
    static let zRecordNo = "z_record_no"
    static let zStatus = "z_status"
    static let idKey = "id_key"
    static let zName = "z_name"
    static let zBidNum = "z_bid_num"
      static let zProvince = "z_province"
      static let zCity = "z_city"
  }

  // MARK: Properties
  public var zTel: String?
  public var zContent: String?
  public var zStaffNm: String?
  public var zTbCompany: String?
  public var zPrice: String?
    public var  zJpPrice: String?
  public var zAddress: String?
  public var zCreateTm: String?
  public var zZbNum: String?
  public var zStaffId: Int?
  public var zRecordNo: String?
  public var zStatus: Int?
  public var idKey: String?
  public var zName: String?
  public var zBidNum: String?
    public var openx = true
    
    public var zProvince: String?
    public var zCity: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    zTel <- map[SerializationKeys.zTel]
    zContent <- map[SerializationKeys.zContent]
    zStaffNm <- map[SerializationKeys.zStaffNm]
    zTbCompany <- map[SerializationKeys.zTbCompany]
    zPrice <- (map[SerializationKeys.zPrice],StringTransform_test())
      zJpPrice <- (map[SerializationKeys.zJpPrice],StringTransform_test())

      
    zAddress <- map[SerializationKeys.zAddress]
    zCreateTm <- map[SerializationKeys.zCreateTm]
    zZbNum <- (map[SerializationKeys.zZbNum],StringTransform())
    zStaffId <- map[SerializationKeys.zStaffId]
    zRecordNo <- map[SerializationKeys.zRecordNo]
    zStatus <- map[SerializationKeys.zStatus]
    idKey <- (map[SerializationKeys.idKey],StringTransform())
    zName <- map[SerializationKeys.zName]
    zBidNum <- (map[SerializationKeys.zBidNum],StringTransform())
      zProvince <- map[SerializationKeys.zProvince]
      
      zCity <- map[SerializationKeys.zCity]

  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = zTel { dictionary[SerializationKeys.zTel] = value }
    if let value = zContent { dictionary[SerializationKeys.zContent] = value }
    if let value = zStaffNm { dictionary[SerializationKeys.zStaffNm] = value }
    if let value = zTbCompany { dictionary[SerializationKeys.zTbCompany] = value }
    if let value = zPrice { dictionary[SerializationKeys.zPrice] = value }
      if let value = zJpPrice { dictionary[SerializationKeys.zJpPrice] = value }

      
    if let value = zAddress { dictionary[SerializationKeys.zAddress] = value }
    if let value = zCreateTm { dictionary[SerializationKeys.zCreateTm] = value }
    if let value = zZbNum { dictionary[SerializationKeys.zZbNum] = value }
    if let value = zStaffId { dictionary[SerializationKeys.zStaffId] = value }
    if let value = zRecordNo { dictionary[SerializationKeys.zRecordNo] = value }
    if let value = zStatus { dictionary[SerializationKeys.zStatus] = value }
      if let value = idKey { dictionary[SerializationKeys.idKey] = value } else {
          dictionary[SerializationKeys.idKey] = ""
      }
    if let value = zName { dictionary[SerializationKeys.zName] = value }
    if let value = zBidNum { dictionary[SerializationKeys.zBidNum] = value }
    return dictionary
  }

}
